Programming ARM chips with OpenOCD in Debian
I bought an LPCXpresso board from NXP for toying around. Unfortunately, the JTAG interface built in this board can only be used with codeRed tools, and the free edition has a limit of 128k of flash memory. I want to use freely available tools, so I cut the board to remove the JTAG part and plugged in my Altera USB-blaster instead.
However, I quickly noticed that the version of OpenOCD built in Debian doesn't work well with it. Searching the web shows it's a bug in libftdi, and you have to use the closed-source libftd2xx instead. The installation works fairly well, just get libftd2xx from FTDI website, copy the so files in /usr/local/lib, then download and compile OpenOCD.
LibFTD2xx install
cd libftd2xx1.0.4 cp build/x86_64/libftd2xx.so.1.0.4 /usr/local/lib pushd . cd /usr/local/lib ln -s libftd2xx.so.1.0.4 libftd2xx.so popd cp ftd2xx.h WinTypes.h /usr/local/include
OpenOCD 0.5.0 install
./configure --enable-usb_blaster_ftd2xx make # ... fix a warning as everything is built in -Wall mode ... make # there seem to be a bug with OpenOCD tools, where it forgets the -lftd2xx here. Do it ourselves : gcc -std=gnu99 -g -O2 -Wall -Wstrict-prototypes -Wformat-security -Wshadow -Wextra -Wno-unused-parameter -Wbad-function-cast -Wcast-align -Wredundant-decls -Werror -o openocd main.o ./.libs/libopenocd.a ../jimtcl/libjim.a -ldl -lftd2xx sudo make install